package math;

import java.util.List;

/**
 * Some simple utilities
 * 
 * @author oliver duerr
 */
public class Utils {

	public static double[] toDoubles(List<Double> list) {
		double[] ret = new double[list.size()];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = list.get(i);
		}
		return ret;
	}
	
	public static long[] toLongs(List<Long> list) {
		long[] ret = new long[list.size()];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = list.get(i);
		}
		return ret;
	}
	
	public static int[] toInts(List<Integer> list) {
		int[] ret = new int[list.size()];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = list.get(i);
		}
		return ret;
	}

	public static double[] toDoublesFromInts(List<Integer> hr) {
		double[] ret = new double[hr.size()];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = hr.get(i);
		}
		return ret;
	}
}
